package com.surekam.mnai.action;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.surekam.mnai.util.LoggerUtil;

/**
 * 权限校验失败后，重新登录服务类。
 * 
 * @author 吴政
 */
public class ReloginServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;

	private static Logger log = LoggerFactory.getLogger(ReloginServlet.class);

	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		methodInvokeLog("doPost(request=" + request + ",response=" + response
				+ ")");

		response.sendRedirect("./login.html");
	}

	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		methodInvokeLog("doPost(request=" + request + ",response=" + response
				+ ")");

		doGet(request, response);
	}

	/**
	 * 方法调用日志。
	 * 
	 * @param methodDesc
	 *            方法描述
	 */
	private void methodInvokeLog(String methodDesc) {
		LoggerUtil.methodInvokeLog(log, getClass(), methodDesc);
	}

}
